/**
 * Alibaba.com.cn Inc.
 * Copyright (c) 2004-2021 All Rights Reserved.
 */
package com.starlink.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author zhanghong
 * @version SchoolbagTypeEnum.java, v 0.1 2024/5/18 16:29 下午 SchoolbagTypeEnum Exp $$
 */
@Getter
@AllArgsConstructor
public enum SchoolbagTypeEnum {
    /**
     * 1星耀版书包 2星辉版书包 3星链版书包 4星辰版书包
     */
    ONE(1, "星耀版书包"),
    TWO(2, "星辉版书包"),
    THREE(3, "星链版书包"),
    FOUR(4, "星辰版书包"),
    ;

    private Integer type;
    private String name;

    public static SchoolbagTypeEnum findByCode(Integer type) {
        if (type == null) {
            return null;
        }
        return Arrays.stream(values()).filter(item->item.getType() == type).findFirst().orElse(null);
    }
}
